Optimal. Leaf size=80 \[ -\frac {b (b B-a C) \log (a \cos (c+d x)+b \sin (c+d x))}{a d \left (a^2+b^2\right )}-\frac {x (b B-a C)}{a^2+b^2}+\frac {B \log (\sin (c+d x))}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.20, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3632, 3611, 3530, 3475} \[ -\frac {b (b B-a C) \log (a \cos (c+d x)+b \sin (c+d x))}{a d \left (a^2+b^2\right )}-\frac {x (b B-a C)}{a^2+b^2}+\frac {B \log (\sin (c+d x))}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3530
Rule 3611
Rule 3632
Rubi steps
\begin {align*} \int \frac {\cot ^2(c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx &=\int \frac {\cot (c+d x) (B+C \tan (c+d x))}{a+b \tan (c+d x)} \, dx\\ &=-\frac {(b B-a C) x}{a^2+b^2}+\frac {B \int \cot (c+d x) \, dx}{a}-\frac {(b (b B-a C)) \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a \left (a^2+b^2\right )}\\ &=-\frac {(b B-a C) x}{a^2+b^2}+\frac {B \log (\sin (c+d x))}{a d}-\frac {b (b B-a C) \log (a \cos (c+d x)+b \sin (c+d x))}{a \left (a^2+b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.37, size = 113, normalized size = 1.41 \[ -\frac {\frac {2 b (b B-a C) \log (a+b \tan (c+d x))}{a \left (a^2+b^2\right )}+\frac {(B+i C) \log (-\tan (c+d x)+i)}{a+i b}+\frac {(B-i C) \log (\tan (c+d x)+i)}{a-i b}-\frac {2 B \log (\tan (c+d x))}{a}}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.67, size = 118, normalized size = 1.48 \[ \frac {2 \, {\left (C a^{2} - B a b\right )} d x + {\left (B a^{2} + B b^{2}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) + {\left (C a b - B b^{2}\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, {\left (a^{3} + a b^{2}\right )} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 4.11, size = 113, normalized size = 1.41 \[ \frac {\frac {2 \, {\left (C a - B b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} - \frac {{\left (B a + C b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {2 \, {\left (C a b^{2} - B b^{3}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{3} b + a b^{3}} + \frac {2 \, B \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.94, size = 174, normalized size = 2.18 \[ -\frac {b^{2} \ln \left (a +b \tan \left (d x +c \right )\right ) B}{d a \left (a^{2}+b^{2}\right )}+\frac {b \ln \left (a +b \tan \left (d x +c \right )\right ) C}{d \left (a^{2}+b^{2}\right )}+\frac {B \ln \left (\tan \left (d x +c \right )\right )}{d a}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a B}{2 d \left (a^{2}+b^{2}\right )}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) C b}{2 d \left (a^{2}+b^{2}\right )}-\frac {B \arctan \left (\tan \left (d x +c \right )\right ) b}{d \left (a^{2}+b^{2}\right )}+\frac {C \arctan \left (\tan \left (d x +c \right )\right ) a}{d \left (a^{2}+b^{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.46, size = 107, normalized size = 1.34 \[ \frac {\frac {2 \, {\left (C a - B b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} + \frac {2 \, {\left (C a b - B b^{2}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{3} + a b^{2}} - \frac {{\left (B a + C b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {2 \, B \log \left (\tan \left (d x + c\right )\right )}{a}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.46, size = 115, normalized size = 1.44 \[ \frac {B\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{a\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-C+B\,1{}\mathrm {i}\right )}{2\,d\,\left (-b+a\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B-C\,1{}\mathrm {i}\right )}{2\,d\,\left (a-b\,1{}\mathrm {i}\right )}-\frac {b\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (B\,b-C\,a\right )}{a\,d\,\left (a^2+b^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 5.75, size = 966, normalized size = 12.08 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________